import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import UserList from '../javaviews/UserList.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'UserList',
        component: UserList,
        meta: {
            layout: 'LayoutJava',
        },
    },
    {
        path: '/Home',
        name: 'Home',
        component: Home,
        meta: {
            layout: 'LayoutNone',
        },
        beforeEnter: function (to, from, next) {
            console.log('beforeRouteEnter:home:路由声明处');
            next();
        }
    },
    {
        path: '/Test',
        name: 'Test',
        component: () => import('../views/Test.vue'),
        meta: {
            layout: 'Layout1',
        },
    },
    {
        path: '/ExampleList1',
        name: 'ExampleList1',
        component: () => import('../views/ExampleList1.vue'),
        meta: {
            layout: 'Layout1',
        },
    },
    {
        path: '/ExampleList2',
        name: 'ExampleList2',
        component: () => import('../views/ExampleList2.vue'),
        meta: {
            layout: 'Layout2',
        },
    },
    {
        path: '/Communication',
        name: 'Communication',
        component: () => import('../views/Communication.vue'),
        meta: {
            layout: 'Layout2',
        },
    },
    {
        path: '/SlotTest',
        name: 'SlotTest',
        component: () => import('../views/SlotTest.vue'),
        meta: {
            layout: 'Layout2',
        },
    },
    {
        path: '/Performance1',
        name: 'Performance1',
        component: () => import('../views/performance/Performance1.vue'),
        meta: {
            layout: 'Layout2',
        },
    },
    {
        path: '/javaviews/UserList',
        name: 'UserList',
        component: () => import('../javaviews/UserList.vue'),
        meta: {
            layout: 'LayoutJava',
        },
    },
    {
        path: '/javaviews/GoodList',
        name: 'GoodList',
        component: () => import('../javaviews/GoodList.vue'),
        meta: {
            layout: 'LayoutJava',
        },
    },
    {
        path: '/javaviews/OrderList',
        name: 'OrderList',
        component: () => import('../javaviews/OrderList.vue'),
        meta: {
            layout: 'LayoutJava',
        },
    },
    {
        path: '/javaviews/UserTest',
        name: 'UserTest',
        component: () => import('../javaviews/UserTest.vue'),
        meta: {
            layout: 'LayoutJava',
        },
    },
    {
        path: '/javaviews/UserLogin',
        name: 'UserLogin',
        component: () => import('../javaviews/UserLogin.vue'),
        meta: {
            layout: 'LayoutNone',
        },
    },

    {
        path: '/ygbhviews/Test01',
        name: 'Test01',
        component: () => import('../ygbhviews/Test01.vue'),
        meta: {
            layout: 'LayoutJava',
        },
    },
]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes
})

export default router
